<?php

namespace Admin\Controller;

//意见反馈

class FeedbackController extends AdminController {

    private $m;

    public function _initialize() {
        parent::_initialize();
        $this->assign("meta_title", "意见反馈列表");
        $this->m = D("Feedback");
    }

    public function index() {
        $where = array();
        $list = $this->lists($this->m, $where);
        $this->assign("list", $list);
        $this->display();
    }


    public function del() {
        $id = array_unique((array) I('id', 0));

        if (empty($id)) {
            $this->error('请选择要操作的数据!');
        }

        $map = array('id' => array('in', $id));
        if ($this->m->where($map)->delete()) {
            // S('DB_CONFIG_DATA',null);
            //记录行为
            action_log('delete_store', 'Store', $id, UID);
            $this->success('删除成功');
        } else {
            $this->error('删除失败！');
        }
    }
    
    //处理意见反馈
    public function changStatus($id,$value = 1){
        $this->editRow('Feedback', array('status'=>$value), array('id'=>$id));
    }

}
